import api from "@/request/index";
import * as CONSTANTS from "@constants/index";

export interface iQueryTokenParams {
  appKey: string,
  appSecret: string,
}

export const getToken = async (): Promise<string> => {
  const {
    VAR_APPKEY: appKey,
    VAR_APPSECRET: appSecret
  } = CONSTANTS;
  const params = { appKey, appSecret }
  const response = await api.queryToken(params);
  const { success = true, data } = response
  if (success) return data;
  return "";
}